load("@rules_proto_grpc//:defs.bzl", "proto_plugin")

proto_plugin(
    name = "docbook_plugin",
    out = "{name}.xml",
    options = [
        "docbook",
        "{name}.xml",
    ],
    quirks = [
        "QUIRK_OUT_PASS_ROOT",
        "QUIRK_DIRECT_MODE",
    ],
    tool = select({
        "@bazel_tools//src/conditions:darwin_arm64": "@protoc_gen_doc_plugins_darwin_arm64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:darwin_x86_64": "@protoc_gen_doc_plugins_darwin_x86_64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:linux_aarch64": "@protoc_gen_doc_plugins_linux_arm64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:linux_x86_64": "@protoc_gen_doc_plugins_linux_x86_64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:windows_arm64": "@protoc_gen_doc_plugins_windows_arm64//:protoc-gen-doc.exe",
        "@bazel_tools//src/conditions:windows_x64": "@protoc_gen_doc_plugins_windows_x86_64//:protoc-gen-doc.exe",
    }),
    visibility = ["//visibility:public"],
)

proto_plugin(
    name = "html_plugin",
    out = "{name}.html",
    options = [
        "html",
        "{name}.html",
    ],
    quirks = [
        "QUIRK_OUT_PASS_ROOT",
        "QUIRK_DIRECT_MODE",
    ],
    tool = select({
        "@bazel_tools//src/conditions:darwin_arm64": "@protoc_gen_doc_plugins_darwin_arm64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:darwin_x86_64": "@protoc_gen_doc_plugins_darwin_x86_64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:linux_aarch64": "@protoc_gen_doc_plugins_linux_arm64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:linux_x86_64": "@protoc_gen_doc_plugins_linux_x86_64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:windows_arm64": "@protoc_gen_doc_plugins_windows_arm64//:protoc-gen-doc.exe",
        "@bazel_tools//src/conditions:windows_x64": "@protoc_gen_doc_plugins_windows_x86_64//:protoc-gen-doc.exe",
    }),
    visibility = ["//visibility:public"],
)

proto_plugin(
    name = "json_plugin",
    out = "{name}.json",
    options = [
        "json",
        "{name}.json",
    ],
    quirks = [
        "QUIRK_OUT_PASS_ROOT",
        "QUIRK_DIRECT_MODE",
    ],
    tool = select({
        "@bazel_tools//src/conditions:darwin_arm64": "@protoc_gen_doc_plugins_darwin_arm64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:darwin_x86_64": "@protoc_gen_doc_plugins_darwin_x86_64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:linux_aarch64": "@protoc_gen_doc_plugins_linux_arm64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:linux_x86_64": "@protoc_gen_doc_plugins_linux_x86_64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:windows_arm64": "@protoc_gen_doc_plugins_windows_arm64//:protoc-gen-doc.exe",
        "@bazel_tools//src/conditions:windows_x64": "@protoc_gen_doc_plugins_windows_x86_64//:protoc-gen-doc.exe",
    }),
    visibility = ["//visibility:public"],
)

proto_plugin(
    name = "markdown_plugin",
    out = "{name}.md",
    options = [
        "markdown",
        "{name}.md",
    ],
    quirks = [
        "QUIRK_OUT_PASS_ROOT",
        "QUIRK_DIRECT_MODE",
    ],
    tool = select({
        "@bazel_tools//src/conditions:darwin_arm64": "@protoc_gen_doc_plugins_darwin_arm64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:darwin_x86_64": "@protoc_gen_doc_plugins_darwin_x86_64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:linux_aarch64": "@protoc_gen_doc_plugins_linux_arm64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:linux_x86_64": "@protoc_gen_doc_plugins_linux_x86_64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:windows_arm64": "@protoc_gen_doc_plugins_windows_arm64//:protoc-gen-doc.exe",
        "@bazel_tools//src/conditions:windows_x64": "@protoc_gen_doc_plugins_windows_x86_64//:protoc-gen-doc.exe",
    }),
    visibility = ["//visibility:public"],
)

proto_plugin(
    name = "template_plugin",
    out = "{name}",
    quirks = [
        "QUIRK_OUT_PASS_ROOT",
        "QUIRK_DIRECT_MODE",
    ],
    separate_options_flag = True,
    tool = select({
        "@bazel_tools//src/conditions:darwin_arm64": "@protoc_gen_doc_plugins_darwin_arm64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:darwin_x86_64": "@protoc_gen_doc_plugins_darwin_x86_64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:linux_aarch64": "@protoc_gen_doc_plugins_linux_arm64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:linux_x86_64": "@protoc_gen_doc_plugins_linux_x86_64//:protoc-gen-doc",
        "@bazel_tools//src/conditions:windows_arm64": "@protoc_gen_doc_plugins_windows_arm64//:protoc-gen-doc.exe",
        "@bazel_tools//src/conditions:windows_x64": "@protoc_gen_doc_plugins_windows_x86_64//:protoc-gen-doc.exe",
    }),
    visibility = ["//visibility:public"],
)
